Sub CurveText(txt As String, numpts As Integer, ptx() As Single, pty() As Single, above As Boolean, nHeight As Long, nWidth As Long, fnWeight As Long, fbItalic As Long, fbUnderline As Long, fbStrikeOut As Long, fbCharSet As Long, fbOutputPrecision As Long, fbClipPrecision As Long, fbQuality As Long, fbPitchAndFamily As Long, lpszFace As String)
MsgBox "Error deleting font object.", vbExclamation
End If
If chnum > Len(txt) Then Exit For
x1 = x2
y1 = y2
Next pt
End Sub
' ***********************************************
' Draw a text string along a circle centered at
' (X, Y) with radius R, centered around the angle
' theta in radians measured counterclockwise from
' the X axis.
' ***********************************************
Sub CircleText(txt As String, X As Single, Y As Single, R As Single, ByVal theta As Single, inside As Boolean, nHeight As Long, nWidth As Long, fnWeight As Long, fbItalic As Long, fbUnderline As Long, fbStrikeOut As Long, fbCharSet As Long, fbOutputPrecision As Long, fbClipPrecision As Long, fbQuality As Long, fbPitchAndFamily As Long, lpszFace As String)
CurveText "Text looks best on a fairly smooth curve.", NUM_PTS, ptx, pty, True, pt, 0, 0, False, False, False, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, CLIP_LH_ANGLES Or CLIP_DEFAULT_PRECIS, PROOF_QUALITY, TRUETYPE_FONTTYPE, fnt
CurveText "Text looks best on a fairly smooth curve.", NUM_PTS, ptx, pty, False, pt, 0, 0, False, False, False, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, CLIP_LH_ANGLES Or CLIP_DEFAULT_PRECIS, PROOF_QUALITY, TRUETYPE_FONTTYPE, fnt
' *****************
' * Circular text *
' *****************
pt = 20
R = 90
X = ScaleWidth / 2
Y = R + 20 + 2 * pt
Circle (X, Y), R
' Text outside the circle.
ang = PI_OVER_2
CircleText "Round and round the mulberry bush", X, Y, R, ang, False, pt, 0, 0, False, False, False, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, CLIP_LH_ANGLES Or CLIP_DEFAULT_PRECIS, PROOF_QUALITY, TRUETYPE_FONTTYPE, "Times New Roman"
ang = -PI_OVER_2
CircleText "The programmer chased the weasel", X, Y, R, ang, False, pt, 0, 0, False, False, False, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, CLIP_LH_ANGLES Or CLIP_DEFAULT_PRECIS, PROOF_QUALITY, TRUETYPE_FONTTYPE, "Times New Roman"
' Text inside the circle.
pt = 15
ang = 0
CircleText "CircleText can display text", X, Y, R, ang, True, pt, 0, 0, False, False, False, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, CLIP_LH_ANGLES Or CLIP_DEFAULT_PRECIS, PROOF_QUALITY, TRUETYPE_FONTTYPE, "Courier New"
ang = PI
CircleText "Inside or outside the circle", X, Y, R, ang, True, pt, 0, 0, False, False, False, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, CLIP_LH_ANGLES Or CLIP_DEFAULT_PRECIS, PROOF_QUALITY, TRUETYPE_FONTTYPE, "Courier New"
' ************************
' * Text along a diamond *
' ************************
pt = 15
' Build the points in the path.
dx = 61
dy = 61
ptx(1) = X - dx: pty(1) = Y
ptx(2) = X: pty(2) = Y - dy
ptx(3) = X + dx: pty(3) = Y
ptx(4) = X: pty(4) = Y + dy
ptx(5) = X - dx: pty(5) = Y
' Display the path.
Line (ptx(1), pty(1))-(ptx(2), pty(2))
For i = 3 To 5
Line -(ptx(i), pty(i))
Next i
' Place text along the path.
CurveText "Sharp corners can cause gaps or overlap when text follows a path.", 5, ptx, pty, True, pt, 0, 0, False, False, False, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, CLIP_LH_ANGLES Or CLIP_DEFAULT_PRECIS, PROOF_QUALITY, TRUETYPE_FONTTYPE, fnt